#include "support_common.h" /* include peripheral declarations and more */
#include <stdio.h>
#include "dtim.h"

void dtim0_delay(int p_usecs)
{
	MCF_DTIM_DTCN0 = 0x00000000;
	MCF_DTIM_RR0 = p_usecs-1;
	MCF_DTIM_DTER0 |= 0x02;
	MCF_DTIM_DTMR0 |= 0x0001;
	while (~MCF_DTIM_DTER0 & 0x02) 
	{
		
	}
}
void dtim0_init()
{
	MCF_DTIM_DTMR0 &= 0xFFFE;
	MCF_DTIM_DTMR0 &= 0x4F0A;
	MCF_DTIM_DTXMR0 = 0x40;
}

